import 'package:fire_chat/model/id_name_model.dart';

class EntityFactory {
  static generateOBJ<T>(json) {
    ///model的判断
    if (T.toString() == "IdNameModel") {
      return IdNameModel.fromJson(json);
    }

    ///listModel的判断
    else if (T.toString() == "List<IdNameModel>") {
      return (json as List).map((v) => IdNameModel.fromJson(v)).toList();
    }
  }
}
